<?php
include_once 'include/control/context.php.inc';
include_once 'include/control/common.php.inc';
require_once('include/dao/UserDAO.php');

if(!$current_usr){
	header("Location: /");	
}

if($_SERVER['REQUEST_METHOD']=="POST"){
	$current_usr->sort = $_POST["sort"];
	$current_usr->profile = $_POST["profile"];
	
	$dao= new UserDAO();
	$dao-> save($current_usr);
	set_current_user($current_usr);
}

include_once 'include/parts/header.php.inc';
?>

<div class="pt10 pb15"><h1 class="blue">编辑个人信息</h1></div>
<div><form action="/profile.php" method="post">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="n_table">
      <tr>
        <th>新浪昵称：</th>
        <td><span class="t14"><?php echo $current_usr->name; ?></span></td>
      </tr>
      <tr>
        <th width="11%">我是：</th>
        <td width="89%">
        <label><input type="radio" name="sort" value="0" <?php echo $current_usr->sort==0 ? "checked":""; ?> />求职者</label>  
        <label><input type="radio" name="sort" value="1" <?php echo $current_usr->sort==1 ? "checked":""; ?> />招聘者</label></td>
      </tr>
      <tr>
        <th>自我介绍：</th>
        <td><textarea name="profile" cols="30" rows="5" class="textarea"><?php echo $current_usr->profile; ?> </textarea></td>
      </tr>
      <tr>
        <th>&nbsp;</th>
        <td><p class="pt15"><input type="submit" class="orange_btn round_10" value="保存" /></p></td>
      </tr>
    </table></form>
</div>
	  

<?php
include_once 'include/parts/footer.php.inc';
?>
